
local IProvider = class("IProvider")


function IProvider:initSDK(args)
    self:callStaticMethod("initSDK",args)
end

function IProvider:login(args)
	self:callStaticMethod("login",args)
end
function IProvider:reportLogin(accountId,serverId)
	self:callStaticMethod("reportLogin",{accountId=accountId,serverId=serverId})
end
function IProvider:getIsLogined()
	return self:callStaticMethod("getIsLogined")=="true"
end
function IProvider:changeAccountListener(args)
	self:callStaticMethod("changeAccountListener",args)
end

function IProvider:canQuickLogin()
	return self:callStaticMethod("canQuickLogin")=="true"
end
function IProvider:quicklogin(args)
	self:callStaticMethod("quicklogin",args)
end
function IProvider:register(args)
	self:callStaticMethod("register",args)
end
function IProvider:getPlatform()
	return self:callStaticMethod("getPlatform")
end

function IProvider:isShowRegister()
	return false
end
-- 是否保存用户
function IProvider:isSaveUser()
	return true
end
function IProvider:logout(args)
	self:callStaticMethod("logout",args)
end

function IProvider:showToolBar(args)
	self:callStaticMethod("showToolBar",args)
end

function IProvider:hideToolBar(args)
	self:callStaticMethod("hideToolBar",args)
end
function IProvider:setIdleTimerDisabled(args)
	self:callStaticMethod("setIdleTimerDisabled",args)
end
function IProvider:onLogout(callback)
	self:callStaticMethod("onLogout",{listener=callback})
end
-- orderID
-- productName = @"1个宝石";         名称不可为空
-- productPrice = 0.01;            人民币：元
-- userParams =  用户自定义参数，服务器异步通知时会原样回传";
function IProvider:charge(args)
	if not args then
		args={}
	end
	args.roleId= l_profile.role.getUserId()  -- 角色id
	args.roleName=l_profile.role.getName() -- 角色名称
	args.roleLevel=l_profile.role.getLevel() -- 角色等级
	args.zoneId=l_global.server.serverId -- 服务器id
	args.zoneName=l_global.server.name -- 服务器名称
	self:callStaticMethod("charge",args)
end

function IProvider:getAppVersion()
	return self:callStaticMethod("getAppVersion")
end
function IProvider:getAppID()
	return self:callStaticMethod("getAppID")
end
function IProvider:getBundleID()
	return self:callStaticMethod("getBundleID")
end
-- roleId 角色id
-- roleName 角色名称
-- roleLevel 角色等级
-- zoneId 服务器id
-- zoneName 服务器名称
-- userBalances  用户余额
-- userVipLevel  用户VIP等级
-- userGang  用户所在公会，帮派
function IProvider:setRoleData(args)
	if self:isFunctionSupported("setRoleData") then
		return self:callStaticMethod("setRoleData",args)
	end
end
function IProvider:isFunctionSupported(functionName)
	return self:callStaticMethod("isFunctionSupported",{functionName=functionName}) == "true"
end
function IProvider:callStaticMethod(methodName,args)
end
return IProvider
